<template>
    <div>
        <Modal v-model="modal.add" title="添加" :mask-closable="false" @on-visible-change="changeModalVisibleResetForm('addForm', $event)" width="1020">
            <Form ref="addForm" :model="form" :label-width="120" :rules="validateRules">
                <Row>
	<i-col span="12">
	<FormItem label="用户编号" prop="userId">
	<InputNumber v-model="form.userId" placeholder="请输入用户编号" style="width: 100%;"/>
</FormItem>
	</i-col>
<i-col span="12">
	<FormItem label="店铺编号" prop="shopId">
	<InputNumber v-model="form.shopId" placeholder="请输入店铺编号" style="width: 100%;"/>
</FormItem>
	</i-col>
<i-col span="12">
	<FormItem label="订单编号" prop="orderId">
	<InputNumber v-model="form.orderId" placeholder="请输入订单编号" style="width: 100%;"/>
</FormItem>
	</i-col>
<i-col span="12">
	<FormItem label="订单项编号" prop="orderItemId">
	<InputNumber v-model="form.orderItemId" placeholder="请输入订单项编号" style="width: 100%;"/>
</FormItem>
	</i-col>
<i-col span="12">
	<FormItem label="订单号" prop="orderNo">
	<Input v-model="form.orderNo" placeholder="请输入订单号" clearable/>
</FormItem>
	</i-col>
<i-col span="12">
	<FormItem label="退款单号" prop="refundNo">
	<InputNumber v-model="form.refundNo" placeholder="请输入退款单号" style="width: 100%;"/>
</FormItem>
	</i-col>
<i-col span="12">
	<FormItem label="支付订单号" prop="transactionNo">
	<Input v-model="form.transactionNo" placeholder="请输入支付订单号" clearable/>
</FormItem>
	</i-col>
<i-col span="12">
	<FormItem label="退款类型" prop="refundType">
	<InputNumber v-model="form.refundType" placeholder="请输入退款类型" style="width: 100%;"/>
</FormItem>
	</i-col>
<i-col span="12">
	<FormItem label="退款订单号" prop="refundTransactionNo">
	<Input v-model="form.refundTransactionNo" placeholder="请输入退款订单号" clearable/>
</FormItem>
	</i-col>
<i-col span="12">
	<FormItem label="申请退款金额" prop="applyRefundAmount">
	<InputNumber v-model="form.applyRefundAmount" placeholder="请输入申请退款金额" style="width: 100%;"/>
</FormItem>
	</i-col>
<i-col span="12">
	<FormItem label="实际退款金额" prop="actualRefundAmount">
	<InputNumber v-model="form.actualRefundAmount" placeholder="请输入实际退款金额" style="width: 100%;"/>
</FormItem>
	</i-col>
<i-col span="12">
	<FormItem label="退款完成时间" prop="refundCompleteTime">
	<DatePicker @on-change="form.refundCompleteTime=$event" :value="form.refundCompleteTime" placeholder="请输入退款完成时间" type="datetime" format="yyyy-MM-dd HH:mm:ss" style="width: 100%;" clearable></DatePicker>
</FormItem>
	</i-col>
<i-col span="12">
	<FormItem label="物流公司名称" prop="logisticsCompany">
	<Input v-model="form.logisticsCompany" placeholder="请输入物流公司名称" clearable/>
</FormItem>
	</i-col>
<i-col span="12">
	<FormItem label="物流公司编码" prop="logisticsCode">
	<Input v-model="form.logisticsCode" placeholder="请输入物流公司编码" clearable/>
</FormItem>
	</i-col>
<i-col span="12">
	<FormItem label="物流单号" prop="logisticsNo">
	<Input v-model="form.logisticsNo" placeholder="请输入物流单号" clearable/>
</FormItem>
	</i-col>
<i-col span="12">
	<FormItem label="退款状态" prop="refundStatus">
	<InputNumber v-model="form.refundStatus" placeholder="请输入退款状态" style="width: 100%;"/>
</FormItem>
	</i-col>
<i-col span="12">
	<FormItem label="申请退款说明" prop="remark">
	<Input v-model="form.remark" placeholder="请输入申请退款说明" clearable/>
</FormItem>
	</i-col>
<i-col span="12">
	<FormItem label="申请退款回复" prop="replyRemark">
	<Input v-model="form.replyRemark" placeholder="请输入申请退款回复" clearable/>
</FormItem>
	</i-col>

</Row>

            </Form>
            <div slot="footer">
                <Button type="text" size="large" @click="resetFormCancelModal('addForm', 'add')">取消</Button>
                <Button type="primary" size="large" @click="add" :loading="loading.add">添加</Button>
            </div>
        </Modal>
        <Modal v-model="modal.edit" title="修改" :mask-closable="false" @on-visible-change="changeModalVisibleResetForm('editForm', $event)" width="1020">
            <Form ref="editForm" :model="form" :label-width="120" :rules="validateRules">
                <Row>
	<i-col span="12">
	<FormItem label="用户编号" prop="userId">
	<InputNumber v-model="form.userId" placeholder="请输入用户编号" style="width: 100%;"/>
</FormItem>
	</i-col>
<i-col span="12">
	<FormItem label="店铺编号" prop="shopId">
	<InputNumber v-model="form.shopId" placeholder="请输入店铺编号" style="width: 100%;"/>
</FormItem>
	</i-col>
<i-col span="12">
	<FormItem label="订单编号" prop="orderId">
	<InputNumber v-model="form.orderId" placeholder="请输入订单编号" style="width: 100%;"/>
</FormItem>
	</i-col>
<i-col span="12">
	<FormItem label="订单项编号" prop="orderItemId">
	<InputNumber v-model="form.orderItemId" placeholder="请输入订单项编号" style="width: 100%;"/>
</FormItem>
	</i-col>
<i-col span="12">
	<FormItem label="订单号" prop="orderNo">
	<Input v-model="form.orderNo" placeholder="请输入订单号" clearable/>
</FormItem>
	</i-col>
<i-col span="12">
	<FormItem label="退款单号" prop="refundNo">
	<InputNumber v-model="form.refundNo" placeholder="请输入退款单号" style="width: 100%;"/>
</FormItem>
	</i-col>
<i-col span="12">
	<FormItem label="支付订单号" prop="transactionNo">
	<Input v-model="form.transactionNo" placeholder="请输入支付订单号" clearable/>
</FormItem>
	</i-col>
<i-col span="12">
	<FormItem label="退款类型" prop="refundType">
	<InputNumber v-model="form.refundType" placeholder="请输入退款类型" style="width: 100%;"/>
</FormItem>
	</i-col>
<i-col span="12">
	<FormItem label="退款订单号" prop="refundTransactionNo">
	<Input v-model="form.refundTransactionNo" placeholder="请输入退款订单号" clearable/>
</FormItem>
	</i-col>
<i-col span="12">
	<FormItem label="申请退款金额" prop="applyRefundAmount">
	<InputNumber v-model="form.applyRefundAmount" placeholder="请输入申请退款金额" style="width: 100%;"/>
</FormItem>
	</i-col>
<i-col span="12">
	<FormItem label="实际退款金额" prop="actualRefundAmount">
	<InputNumber v-model="form.actualRefundAmount" placeholder="请输入实际退款金额" style="width: 100%;"/>
</FormItem>
	</i-col>
<i-col span="12">
	<FormItem label="退款完成时间" prop="refundCompleteTime">
	<DatePicker @on-change="form.refundCompleteTime=$event" :value="form.refundCompleteTime" placeholder="请输入退款完成时间" type="datetime" format="yyyy-MM-dd HH:mm:ss" style="width: 100%;" clearable></DatePicker>
</FormItem>
	</i-col>
<i-col span="12">
	<FormItem label="物流公司名称" prop="logisticsCompany">
	<Input v-model="form.logisticsCompany" placeholder="请输入物流公司名称" clearable/>
</FormItem>
	</i-col>
<i-col span="12">
	<FormItem label="物流公司编码" prop="logisticsCode">
	<Input v-model="form.logisticsCode" placeholder="请输入物流公司编码" clearable/>
</FormItem>
	</i-col>
<i-col span="12">
	<FormItem label="物流单号" prop="logisticsNo">
	<Input v-model="form.logisticsNo" placeholder="请输入物流单号" clearable/>
</FormItem>
	</i-col>
<i-col span="12">
	<FormItem label="退款状态" prop="refundStatus">
	<InputNumber v-model="form.refundStatus" placeholder="请输入退款状态" style="width: 100%;"/>
</FormItem>
	</i-col>
<i-col span="12">
	<FormItem label="申请退款说明" prop="remark">
	<Input v-model="form.remark" placeholder="请输入申请退款说明" clearable/>
</FormItem>
	</i-col>
<i-col span="12">
	<FormItem label="申请退款回复" prop="replyRemark">
	<Input v-model="form.replyRemark" placeholder="请输入申请退款回复" clearable/>
</FormItem>
	</i-col>

</Row>

            </Form>
            <div slot="footer">
                <Button type="text" size="large" @click="resetFormCancelModal('editForm', 'edit')">取消</Button>
                <Button type="primary" size="large" @click="edit" :loading="loading.edit">修改</Button>
            </div>
        </Modal>
    </div>
</template>

<script>
    import * as utils from '@/api/utils-v2'
    import * as ResponseStatus from '@/api/response-status'
    export default {
        name: 'GoodsOrderRefundAddEdit',
        data() {
            return {
                modal: {
                    add: false,
                    edit: false
                },
                loading: {
                    add: false,
                    edit: false
                },
                urls: {
                    addUrl: '/goods-order-refund/admin/save',
                    batchAddUrl: '/goods-order-refund/admin/batch-save',
                    editUrl: '/goods-order-refund/admin/update',
                    batchEditUrl: '/goods-order-refund/admin/batch-update'
                },
                form: {
                    userId: null,
shopId: null,
orderId: null,
orderItemId: null,
orderNo: null,
refundNo: null,
transactionNo: null,
refundType: null,
refundTransactionNo: null,
applyRefundAmount: null,
actualRefundAmount: null,
refundCompleteTime: null,
logisticsCompany: null,
logisticsCode: null,
logisticsNo: null,
refundStatus: null,
remark: null,
replyRemark: null,

                },
                validateRules: {
                    userId: [
{type: 'integer', required: true, message: '此项为必须项', trigger: 'blur, change'}
],
shopId: [
{type: 'integer', required: true, message: '此项为必须项', trigger: 'blur, change'}
],
orderId: [
{type: 'integer', required: true, message: '此项为必须项', trigger: 'blur, change'}
],
orderItemId: [
{type: 'integer', required: true, message: '此项为必须项', trigger: 'blur, change'}
],
orderNo: [
{type: 'string', required: true, message: '此项为必须项', trigger: 'blur'},
{type: 'string', min: 1, max: 50, message: '必须1-50个字符', trigger: 'blur'}
],
refundNo: [
{type: 'integer', required: true, message: '此项为必须项', trigger: 'blur, change'}
],
transactionNo: [
{type: 'string', required: true, message: '此项为必须项', trigger: 'blur'},
{type: 'string', min: 1, max: 50, message: '必须1-50个字符', trigger: 'blur'}
],
refundType: [
{type: 'integer', required: true, message: '此项为必须项', trigger: 'blur, change'}
],
refundTransactionNo: [
{type: 'string', min: 1, max: 50, message: '必须1-50个字符', trigger: 'blur'}
],
applyRefundAmount: [
{type: 'number', required: true, message: '此项为必须项', trigger: 'blur, change'}
],
actualRefundAmount: [
{type: 'number', required: true, message: '此项为必须项', trigger: 'blur, change'}
],
logisticsCompany: [
{type: 'string', min: 1, max: 255, message: '必须1-255个字符', trigger: 'blur'}
],
logisticsCode: [
{type: 'string', min: 1, max: 20, message: '必须1-20个字符', trigger: 'blur'}
],
logisticsNo: [
{type: 'string', min: 1, max: 32, message: '必须1-32个字符', trigger: 'blur'}
],
remark: [
{type: 'string', min: 1, max: 1000, message: '必须1-1000个字符', trigger: 'blur'}
],
replyRemark: [
{type: 'string', min: 1, max: 1000, message: '必须1-1000个字符', trigger: 'blur'}
],

                },
                dataDictCodes: [],
                dataDictItems: {},
            }
        },
        computed: {},
        mounted() {},
        methods: {
            changeModalVisibleResetForm(formRef, visible) {
                if (!visible) {
					this.$refs[formRef].resetFields()
					this.form.id = null
                }
            },
            resetFormCancelModal(formRef, modal) {
                this.modal[modal] = false
			    this.$refs[formRef].resetFields()
				this.form.id = null
            },
            add() {
                this.$emit('add')
            },
            edit() {
                this.$emit('edit')
            }
        }
    }
</script>

<style>
</style>